<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Faiss: faiss::gpu::IVFPQ Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Faiss
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacefaiss.html">faiss</a></li><li class="navelem"><b>gpu</b></li><li class="navelem"><a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html">IVFPQ</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classfaiss_1_1gpu_1_1IVFPQ-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">faiss::gpu::IVFPQ Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Implementing class for <a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html" title="Implementing class for IVFPQ on the GPU. ">IVFPQ</a> on the GPU.  
 <a href="classfaiss_1_1gpu_1_1IVFPQ.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for faiss::gpu::IVFPQ:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classfaiss_1_1gpu_1_1IVFPQ.png" usemap="#faiss::gpu::IVFPQ_map" alt=""/>
  <map id="faiss::gpu::IVFPQ_map" name="faiss::gpu::IVFPQ_map">
<area href="classfaiss_1_1gpu_1_1IVFBase.html" title="Base inverted list functionality for IVFFlat and IVFPQ. " alt="faiss::gpu::IVFBase" shape="rect" coords="0,0,119,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a18cfe8bf2178468f3372727d0b0bbc33"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html#a18cfe8bf2178468f3372727d0b0bbc33">IVFPQ</a> (<a class="el" href="classfaiss_1_1gpu_1_1GpuResources.html">GpuResources</a> *resources, <a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html">FlatIndex</a> *quantizer, int numSubQuantizers, int bitsPerSubQuantizer, float *pqCentroidData, IndicesOptions indicesOptions, bool useFloat16LookupTables, MemorySpace space)</td></tr>
<tr class="separator:a18cfe8bf2178468f3372727d0b0bbc33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adcee5dbf48c3cb6b8a67f5f392e155fd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adcee5dbf48c3cb6b8a67f5f392e155fd"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html#adcee5dbf48c3cb6b8a67f5f392e155fd">setPrecomputedCodes</a> (bool enable)</td></tr>
<tr class="memdesc:adcee5dbf48c3cb6b8a67f5f392e155fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable or disable pre-computed codes. <br/></td></tr>
<tr class="separator:adcee5dbf48c3cb6b8a67f5f392e155fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9992b38226dc8f92ca2691582fabb675"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html#a9992b38226dc8f92ca2691582fabb675">addCodeVectorsFromCpu</a> (int listId, const void *codes, const long *indices, size_t numVecs)</td></tr>
<tr class="separator:a9992b38226dc8f92ca2691582fabb675"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1e07b04b25569cc58c5f3f033f4dab3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html#ab1e07b04b25569cc58c5f3f033f4dab3">classifyAndAddVectors</a> (<a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; float, 2, true &gt; &amp;vecs, <a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; long, 1, true &gt; &amp;indices)</td></tr>
<tr class="separator:ab1e07b04b25569cc58c5f3f033f4dab3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0c458aab9a3d903f31b0e63ce16e623"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html#ab0c458aab9a3d903f31b0e63ce16e623">query</a> (<a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; float, 2, true &gt; &amp;queries, int nprobe, int k, <a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; float, 2, true &gt; &amp;outDistances, <a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; long, 2, true &gt; &amp;outIndices)</td></tr>
<tr class="separator:ab0c458aab9a3d903f31b0e63ce16e623"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b349dd021b11b5f48531825359b0657"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5b349dd021b11b5f48531825359b0657"></a>
std::vector&lt; unsigned char &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html#a5b349dd021b11b5f48531825359b0657">getListCodes</a> (int listId) const </td></tr>
<tr class="memdesc:a5b349dd021b11b5f48531825359b0657"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the list codes of a particular list back to the CPU. <br/></td></tr>
<tr class="separator:a5b349dd021b11b5f48531825359b0657"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e8bff50f894c243c62e832f923e88e7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; float, 3, true &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html#a3e8bff50f894c243c62e832f923e88e7">getPQCentroids</a> ()</td></tr>
<tr class="separator:a3e8bff50f894c243c62e832f923e88e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classfaiss_1_1gpu_1_1IVFBase')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html">faiss::gpu::IVFBase</a></td></tr>
<tr class="memitem:a80130acfe0a2a4d387a5c9ee4c386b9c inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a80130acfe0a2a4d387a5c9ee4c386b9c">IVFBase</a> (<a class="el" href="classfaiss_1_1gpu_1_1GpuResources.html">GpuResources</a> *resources, <a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html">FlatIndex</a> *quantizer, int bytesPerVector, IndicesOptions indicesOptions, MemorySpace space)</td></tr>
<tr class="separator:a80130acfe0a2a4d387a5c9ee4c386b9c inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02e1e2d080ee31bf7835f89b9f2a13a9 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02e1e2d080ee31bf7835f89b9f2a13a9"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a02e1e2d080ee31bf7835f89b9f2a13a9">reserveMemory</a> (size_t numVecs)</td></tr>
<tr class="memdesc:a02e1e2d080ee31bf7835f89b9f2a13a9 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reserve GPU memory in our inverted lists for this number of vectors. <br/></td></tr>
<tr class="separator:a02e1e2d080ee31bf7835f89b9f2a13a9 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ea671876443c93436499ad581f16997 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a7ea671876443c93436499ad581f16997">reset</a> ()</td></tr>
<tr class="separator:a7ea671876443c93436499ad581f16997 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d44e8aebc380b7c846a8d8e6e835540 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4d44e8aebc380b7c846a8d8e6e835540"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a4d44e8aebc380b7c846a8d8e6e835540">getDim</a> () const </td></tr>
<tr class="memdesc:a4d44e8aebc380b7c846a8d8e6e835540 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of dimensions we are indexing. <br/></td></tr>
<tr class="separator:a4d44e8aebc380b7c846a8d8e6e835540 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9b69e1b2582cb2c064b5fff60d31cc8 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#ac9b69e1b2582cb2c064b5fff60d31cc8">reclaimMemory</a> ()</td></tr>
<tr class="separator:ac9b69e1b2582cb2c064b5fff60d31cc8 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd66dc9d32e6150b930d78f74d7dd2d7 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd66dc9d32e6150b930d78f74d7dd2d7"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#abd66dc9d32e6150b930d78f74d7dd2d7">getNumLists</a> () const </td></tr>
<tr class="memdesc:abd66dc9d32e6150b930d78f74d7dd2d7 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of inverted lists. <br/></td></tr>
<tr class="separator:abd66dc9d32e6150b930d78f74d7dd2d7 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b1ee21f9919fb077db5e48e91943582 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a7b1ee21f9919fb077db5e48e91943582">getListLength</a> (int listId) const </td></tr>
<tr class="separator:a7b1ee21f9919fb077db5e48e91943582 inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a4ed220b9433aa788ed32db8f20a9db inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4a4ed220b9433aa788ed32db8f20a9db"></a>
std::vector&lt; long &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a4a4ed220b9433aa788ed32db8f20a9db">getListIndices</a> (int listId) const </td></tr>
<tr class="memdesc:a4a4ed220b9433aa788ed32db8f20a9db inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the list indices of a particular list back to the CPU. <br/></td></tr>
<tr class="separator:a4a4ed220b9433aa788ed32db8f20a9db inherit pub_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:adb58eeacdceb0e0fde1820ca7f116e05"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adb58eeacdceb0e0fde1820ca7f116e05"></a>
static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html#adb58eeacdceb0e0fde1820ca7f116e05">isSupportedPQCodeLength</a> (int size)</td></tr>
<tr class="memdesc:adb58eeacdceb0e0fde1820ca7f116e05"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if we support PQ in this size. <br/></td></tr>
<tr class="separator:adb58eeacdceb0e0fde1820ca7f116e05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0eedf0295ad73125ee1254173a176674"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html#a0eedf0295ad73125ee1254173a176674">isSupportedNoPrecomputedSubDimSize</a> (int dims)</td></tr>
<tr class="separator:a0eedf0295ad73125ee1254173a176674"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_methods_classfaiss_1_1gpu_1_1IVFBase"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classfaiss_1_1gpu_1_1IVFBase')"><img src="closed.png" alt="-"/>&#160;Protected Member Functions inherited from <a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html">faiss::gpu::IVFBase</a></td></tr>
<tr class="memitem:aa02d69306544294521e79be7f81a21cb inherit pro_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#aa02d69306544294521e79be7f81a21cb">reclaimMemory_</a> (bool exact)</td></tr>
<tr class="separator:aa02d69306544294521e79be7f81a21cb inherit pro_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc695610c9513952b8d234dc0db78e5c inherit pro_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acc695610c9513952b8d234dc0db78e5c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#acc695610c9513952b8d234dc0db78e5c">updateDeviceListInfo_</a> (cudaStream_t stream)</td></tr>
<tr class="memdesc:acc695610c9513952b8d234dc0db78e5c inherit pro_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Update all device-side list pointer and size information. <br/></td></tr>
<tr class="separator:acc695610c9513952b8d234dc0db78e5c inherit pro_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae90724e307bbfe49554a2ab77fbd1764 inherit pro_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#ae90724e307bbfe49554a2ab77fbd1764">updateDeviceListInfo_</a> (const std::vector&lt; int &gt; &amp;listIds, cudaStream_t stream)</td></tr>
<tr class="separator:ae90724e307bbfe49554a2ab77fbd1764 inherit pro_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5027720549de98f4e609d6339099df35 inherit pro_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5027720549de98f4e609d6339099df35"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a5027720549de98f4e609d6339099df35">addIndicesFromCpu_</a> (int listId, const long *indices, size_t numVecs)</td></tr>
<tr class="memdesc:a5027720549de98f4e609d6339099df35 inherit pro_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shared function to copy indices from CPU to GPU. <br/></td></tr>
<tr class="separator:a5027720549de98f4e609d6339099df35 inherit pro_methods_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classfaiss_1_1gpu_1_1IVFBase')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html">faiss::gpu::IVFBase</a></td></tr>
<tr class="memitem:a05e6400358ec1f529a67209d3f24cc63 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a05e6400358ec1f529a67209d3f24cc63"></a>
<a class="el" href="classfaiss_1_1gpu_1_1GpuResources.html">GpuResources</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a05e6400358ec1f529a67209d3f24cc63">resources_</a></td></tr>
<tr class="memdesc:a05e6400358ec1f529a67209d3f24cc63 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Collection of GPU resources that we use. <br/></td></tr>
<tr class="separator:a05e6400358ec1f529a67209d3f24cc63 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a878114abdba07c9cf7735f9c0ed594c3 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a878114abdba07c9cf7735f9c0ed594c3"></a>
<a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html">FlatIndex</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a878114abdba07c9cf7735f9c0ed594c3">quantizer_</a></td></tr>
<tr class="memdesc:a878114abdba07c9cf7735f9c0ed594c3 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quantizer object. <br/></td></tr>
<tr class="separator:a878114abdba07c9cf7735f9c0ed594c3 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba3e3cfa469e5187f2d553fff10e0250 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aba3e3cfa469e5187f2d553fff10e0250"></a>
const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#aba3e3cfa469e5187f2d553fff10e0250">dim_</a></td></tr>
<tr class="memdesc:aba3e3cfa469e5187f2d553fff10e0250 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Expected dimensionality of the vectors. <br/></td></tr>
<tr class="separator:aba3e3cfa469e5187f2d553fff10e0250 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:accc4d96c14643e5f471220cb1e92ac70 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="accc4d96c14643e5f471220cb1e92ac70"></a>
const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#accc4d96c14643e5f471220cb1e92ac70">numLists_</a></td></tr>
<tr class="memdesc:accc4d96c14643e5f471220cb1e92ac70 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of inverted lists we maintain. <br/></td></tr>
<tr class="separator:accc4d96c14643e5f471220cb1e92ac70 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a319568b832518392fed33ea4f8bfc613 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a319568b832518392fed33ea4f8bfc613"></a>
const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a319568b832518392fed33ea4f8bfc613">bytesPerVector_</a></td></tr>
<tr class="memdesc:a319568b832518392fed33ea4f8bfc613 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of bytes per vector in the list. <br/></td></tr>
<tr class="separator:a319568b832518392fed33ea4f8bfc613 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb6d10e23d6448c10f472b9234e0bcab inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afb6d10e23d6448c10f472b9234e0bcab"></a>
const IndicesOptions&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#afb6d10e23d6448c10f472b9234e0bcab">indicesOptions_</a></td></tr>
<tr class="memdesc:afb6d10e23d6448c10f472b9234e0bcab inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">How are user indices stored on the GPU? <br/></td></tr>
<tr class="separator:afb6d10e23d6448c10f472b9234e0bcab inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a30499eb61763df72cab25ea9d1235251 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a30499eb61763df72cab25ea9d1235251"></a>
const MemorySpace&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a30499eb61763df72cab25ea9d1235251">space_</a></td></tr>
<tr class="memdesc:a30499eb61763df72cab25ea9d1235251 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">What memory space our inverted list storage is in. <br/></td></tr>
<tr class="separator:a30499eb61763df72cab25ea9d1235251 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96240a08b42bd1913e2286d7d514fc56 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top">thrust::device_vector&lt; void * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a96240a08b42bd1913e2286d7d514fc56">deviceListDataPointers_</a></td></tr>
<tr class="separator:a96240a08b42bd1913e2286d7d514fc56 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9aedcf0e6a20b908980ae96d73461f4c inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top">thrust::device_vector&lt; void * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a9aedcf0e6a20b908980ae96d73461f4c">deviceListIndexPointers_</a></td></tr>
<tr class="separator:a9aedcf0e6a20b908980ae96d73461f4c inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a1c2031a4763f7d55bc8a400c63af66 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top">thrust::device_vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a3a1c2031a4763f7d55bc8a400c63af66">deviceListLengths_</a></td></tr>
<tr class="separator:a3a1c2031a4763f7d55bc8a400c63af66 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae25ea0901fb628844868413f51c85bda inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae25ea0901fb628844868413f51c85bda"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#ae25ea0901fb628844868413f51c85bda">maxListLength_</a></td></tr>
<tr class="memdesc:ae25ea0901fb628844868413f51c85bda inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum list length seen. <br/></td></tr>
<tr class="separator:ae25ea0901fb628844868413f51c85bda inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2facc7285107de1f24d3471cbcf15f26 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::unique_ptr<br class="typebreak"/>
&lt; <a class="el" href="classfaiss_1_1gpu_1_1DeviceVector.html">DeviceVector</a>&lt; unsigned char &gt; &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a2facc7285107de1f24d3471cbcf15f26">deviceListData_</a></td></tr>
<tr class="separator:a2facc7285107de1f24d3471cbcf15f26 inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c364dbd74e459db976b7c3a8e3d9f1b inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2c364dbd74e459db976b7c3a8e3d9f1b"></a>
std::vector&lt; std::unique_ptr<br class="typebreak"/>
&lt; <a class="el" href="classfaiss_1_1gpu_1_1DeviceVector.html">DeviceVector</a>&lt; unsigned char &gt; &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>deviceListIndices_</b></td></tr>
<tr class="separator:a2c364dbd74e459db976b7c3a8e3d9f1b inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53f3c382a79b7f89630a85dfbc3a1fed inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; long &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a53f3c382a79b7f89630a85dfbc3a1fed">listOffsetToUserIndex_</a></td></tr>
<tr class="separator:a53f3c382a79b7f89630a85dfbc3a1fed inherit pro_attribs_classfaiss_1_1gpu_1_1IVFBase"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Implementing class for <a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html" title="Implementing class for IVFPQ on the GPU. ">IVFPQ</a> on the GPU. </p>

<p>Definition at line <a class="el" href="IVFPQ_8cuh_source.html#l00017">17</a> of file <a class="el" href="IVFPQ_8cuh_source.html">IVFPQ.cuh</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a18cfe8bf2178468f3372727d0b0bbc33"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">faiss::gpu::IVFPQ::IVFPQ </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classfaiss_1_1gpu_1_1GpuResources.html">GpuResources</a> *&#160;</td>
          <td class="paramname"><em>resources</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html">FlatIndex</a> *&#160;</td>
          <td class="paramname"><em>quantizer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numSubQuantizers</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>bitsPerSubQuantizer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>pqCentroidData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">IndicesOptions&#160;</td>
          <td class="paramname"><em>indicesOptions</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>useFloat16LookupTables</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">MemorySpace&#160;</td>
          <td class="paramname"><em>space</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">quantizer</td><td>We do not own this reference </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="IVFPQ_8cu_source.html#l00033">33</a> of file <a class="el" href="IVFPQ_8cu_source.html">IVFPQ.cu</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a9992b38226dc8f92ca2691582fabb675"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::gpu::IVFPQ::addCodeVectorsFromCpu </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>listId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>codes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const long *&#160;</td>
          <td class="paramname"><em>indices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>numVecs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Adds a set of codes and indices to a list; the data can be resident on either the host or the device </p>

<p>Definition at line <a class="el" href="IVFPQ_8cu_source.html#l00345">345</a> of file <a class="el" href="IVFPQ_8cu_source.html">IVFPQ.cu</a>.</p>

</div>
</div>
<a class="anchor" id="ab1e07b04b25569cc58c5f3f033f4dab3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int faiss::gpu::IVFPQ::classifyAndAddVectors </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; float, 2, true &gt; &amp;&#160;</td>
          <td class="paramname"><em>vecs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; long, 1, true &gt; &amp;&#160;</td>
          <td class="paramname"><em>indices</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Calcuates the residual and quantizes the vectors, adding them to this index The input data must be on our current device. Returns the number of vectors successfully added. Vectors may not be able to be added because they contain NaNs. </p>

<p>Definition at line <a class="el" href="IVFPQ_8cu_source.html#l00118">118</a> of file <a class="el" href="IVFPQ_8cu_source.html">IVFPQ.cu</a>.</p>

</div>
</div>
<a class="anchor" id="a3e8bff50f894c243c62e832f923e88e7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; float, 3, true &gt; faiss::gpu::IVFPQ::getPQCentroids </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns our set of sub-quantizers of the form (sub q)(code id)(sub dim) </p>

<p>Definition at line <a class="el" href="IVFPQ_8cu_source.html#l00591">591</a> of file <a class="el" href="IVFPQ_8cu_source.html">IVFPQ.cu</a>.</p>

</div>
</div>
<a class="anchor" id="a0eedf0295ad73125ee1254173a176674"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool faiss::gpu::IVFPQ::isSupportedNoPrecomputedSubDimSize </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dims</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>For no precomputed codes, is this a supported sub-dimension size? FIXME: get MM implementation working again </p>

<p>Definition at line <a class="el" href="IVFPQ_8cu_source.html#l00095">95</a> of file <a class="el" href="IVFPQ_8cu_source.html">IVFPQ.cu</a>.</p>

</div>
</div>
<a class="anchor" id="ab0c458aab9a3d903f31b0e63ce16e623"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::gpu::IVFPQ::query </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; float, 2, true &gt; &amp;&#160;</td>
          <td class="paramname"><em>queries</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>nprobe</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>k</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; float, 2, true &gt; &amp;&#160;</td>
          <td class="paramname"><em>outDistances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; long, 2, true &gt; &amp;&#160;</td>
          <td class="paramname"><em>outIndices</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Find the approximate k nearest neigbors for <code>queries</code> against our database </p>

<p>Definition at line <a class="el" href="IVFPQ_8cu_source.html#l00516">516</a> of file <a class="el" href="IVFPQ_8cu_source.html">IVFPQ.cu</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/data/users/hoss/faiss/gpu/impl/<a class="el" href="IVFPQ_8cuh_source.html">IVFPQ.cuh</a></li>
<li>/data/users/hoss/faiss/gpu/impl/<a class="el" href="IVFPQ_8cu_source.html">IVFPQ.cu</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
